package com.itheima.qqfarm.servlet.manager;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.itheima.qqfarm.bean.Customer;
import com.itheima.qqfarm.bean.User;
import com.itheima.qqfarm.factory.BeanFactory;
import com.itheima.qqfarm.service.CustomerService;

import com.itheima.qqfarm.service.UserService;
import com.itheima.qqfarm.servlet.BaseServlet;
import com.itheima.qqfarm.util.TransacationProxyUtils;
import com.itheima.qqfarm.util.WebUtils;

/**
 * 
 */
public class CustomerServlet extends BaseServlet {
	private static final long serialVersionUID = 1L;


	private CustomerService customerService = TransacationProxyUtils.getProxy(BeanFactory.get(CustomerService.class));

	/*
	 * 显示注册用户列表
	 */
	public void showCustomers(HttpServletRequest request, HttpServletResponse response) throws ServletException,
			IOException {
		System.out.println("---CustomerServlet showCustomers()");

		List<Customer> customers = customerService.getAllCustomers();

		request.setAttribute("customers", customers);

		request.getRequestDispatcher("/manager/manager.jsp").forward(request, response);
	}


}
